export default {
  // 总数量
  totalCount (state) {
    return state.todos.length
  },
  // 完成的数量
  completeSize (state) {
    return state.todos.reduce((preTotal, todo) => preTotal + (todo.complete ? 1 : 0), 0)
  },
  // 是否全部勾选
  checkAll (state, getters) {
    return getters.completeSize === getters.totalCount && getters.totalCount > 1
  }
}
